﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="frmBuscarProveedor.aspx.cs" Inherits="Farmacia.net.Compras.Proveedor.frmBuscarProveedor" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style3
        {
            width: 100%;
        }
        .style4
        {
            width: 340px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Buscar Proveedor</h2>

<fieldset>
    <legend>Proveedor</legend>
    <table class="style3">
        <tr>
            <td>
                &nbsp;</td>
            <td style="text-align: right" width="200">
    <asp:Label ID="Label1" runat="server" Text="Ingrese Ruc:" style="text-align: right"></asp:Label>
            </td>
            <td class="style4">
    <asp:TextBox ID="txtRuc" runat="server" Width="350px"></asp:TextBox>
            </td>
            <td>
    <asp:ImageButton ID="btnBuscar" runat="server" Text="Buscar" 
                    ImageUrl="~/Images/1340835453_file_search.png" Width="25px" />

            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
    <br />

</fieldset>

<fieldset>
<legend>Listado de Proveedores </legend>
    <asp:Label ID="lblMensaje" runat="server" Font-Bold="True" ForeColor="red" ></asp:Label>
    <asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" 
        GridLines="None" DataSourceID="odsProveedor" AutoGenerateColumns="False" 
        Width="100%" onrowcommand="GridView1_RowCommand">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="Ruc" HeaderText="Ruc" SortExpression="Ruc" />
            <asp:HyperLinkField DataNavigateUrlFields="idProveedor" 
                DataNavigateUrlFormatString="frmRegistrarProveedor.aspx?acc=ver&amp;idProveedor={0}" 
                DataTextField="RazonSocial" HeaderText="RazonSocial" Text="RazonSocial">
            <ItemStyle Width="250px" />
            </asp:HyperLinkField>
            <asp:BoundField DataField="Direccion" HeaderText="Direccion" 
                SortExpression="Direccion" >
            <ControlStyle Width="150px" />
            <ItemStyle Width="250px" />
            </asp:BoundField>
            <asp:BoundField DataField="Telefono" HeaderText="Telefono" 
                SortExpression="Telefono" >
            <ItemStyle Width="50px" />
            </asp:BoundField>
            <asp:BoundField DataField="Movil" HeaderText="Movil" 
                SortExpression="Movil" />
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:ImageButton ID="ImageButton1" runat="server" 
                        ImageUrl="~/Images/1340864176_file_edit.png" 
                        PostBackUrl='<%# Eval("IdProveedor","frmRegistrarProveedor.aspx?acc=editar&amp;IdProveedor={0}") %>' ToolTip="Editar"  Width="25px" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:ImageButton ID="ImageButton2" runat="server" CommandName="Eliminar" 
                        ImageUrl="~/Images/1340849209_close.png" Width="25px"
                        OnClientClick="confirm('Desea Eliminar el Laboratorio');" CausesValidation="False" 
                        PostBackUrl='<%# Eval("IdProveedor","frmRegistrarProveedor.aspx?acc=eliminar&IdProveedor={0}") %>' 
                        ToolTip="Eliminar"  />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    <asp:ObjectDataSource ID="odsProveedor" runat="server" 
        SelectMethod="GetFromProveedorByRuc" 
        TypeName="Farmacia.BussinessLogic.ProveedorBL" 
        onobjectcreating="odsProveedor_ObjectCreating" 
        ondeleted="odsProveedor_Deleted">
        <SelectParameters>
            <asp:ControlParameter ControlID="txtRuc" DefaultValue="%" Name="ruc" 
                PropertyName="Text" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
</fieldset>
</asp:Content>
